
# local test
# docker run -it -v D:\git_proj\juqidjango:/app -w /app  ccr.ccs.tencentyun.com/mkmk-common/a:juqidjango-black-v1 /bin/sh
# sh juqi_server/script/py_unittest.sh.sh

set -eux

export PATH=${PATH}:/root/.local/bin

# juqi_server
work_dir=$(dirname $(dirname $(realpath $0)))
proj_root=$(dirname ${work_dir})

# test_output
test_output=${proj_root}/output/py_unittest
mkdir -p ${test_output}

echo "py_unittest wordir: $work_dir"

cd $work_dir

python3 manage.py test --parallel

if [ $? == 0 ]
then
    echo "py_unittest success" | tee ${test_output}/test.log
else
    echo "py_unittest fail"
    exit 1
fi
